<?php defined('SYSPATH') or die('No direct script access.'); ?>
<style type="text/css">
    table.userlist {
        margin: 20px auto;
        width: 100%;
        text-align: left;
        border-collapse: collapse;
    }
    .userlist .main td {
        background-color: #555555;
        color: #ffffff;
        padding: 5px 10px;
        font-weight: normal;
    }
    .userlist td {
        color: #666666;
        padding: 5px 10px;
    }
    .userlist a {
        color: #666666;
        font-weight: bold;
    }
</style>
    
<?php if(count($orders)): ?>
<h1 style="text-align: center">My orders</h1>
<table class="userlist" style="width:96%">
    <tr class="main">
       
        <td colspan="3">Orders</td>
      
    
    </tr>
<?php
foreach ($orders as $i => $it)
    if(is_array($it))
    {
        ?>
        <tr>
            <td><?php echo $it['date'];?></td>
            <td>Price</td>
            <td>Quantity</td>
        </tr>

        
            <?php foreach ($it['products'] as $p):?>
        <tr>
            <td>
                <a href="/shop/product/<?php echo $p['asin'];?>">
                    <?php echo htmlspecialchars($p['title']);?></a>
            </td>
            <td><?php echo $p['price'];?></td>
            <td><?php echo $p['quantity'];?></td>
      
            </tr>
            <?php endforeach;?>
          <tr><td colspan="3">&nbsp;</td></tr>
        
        <?php
    }

?>
    
   
</table>

<?php else: ?>
    <br /><br /><br />
    <center>You haven't orders</center>
    <br /><br />
<?php endif;
